﻿using AutoMapper;
using Order.Api.Read.Dto.Order;
using Order.Domain.OrderDomain;
using System.ComponentModel;

namespace Order.Api.Read.AutoMapper
{
    public class OrderMapper : Profile
    {
        public OrderMapper()
        {
            // 退款实体到DTO映射
            CreateMap<Refund, RefundPageDto>();

            // 退款详情映射
            CreateMap<Refund, RefundDetailDto>()
                .ForMember(dest => dest.RefundStatusDesc, opt => opt.Ignore())
                .ForMember(dest => dest.RefundMethodDesc, opt => opt.Ignore())
                .ForMember(dest => dest.OrderTypeDesc, opt => opt.Ignore())
                .ForMember(dest => dest.RefundSourceDesc, opt => opt.Ignore())
                .ForMember(dest => dest.UserPhone, opt => opt.Ignore())
                .ForMember(dest => dest.OrderNo, opt => opt.Ignore())
                .ForMember(dest => dest.OrderAmount, opt => opt.Ignore());

            // 药品订单分页映射
            CreateMap<DrugOrders, DrugOrdersPageDto>()
                .ForMember(dest => dest.Phone, opt => opt.Ignore())
                .ForMember(dest => dest.Consignee, opt => opt.Ignore())
                .ForMember(dest => dest.OrderStatusName, opt => opt.Ignore());
        }
    }
}
